---------------table TBL_CUSTOMER
delete from [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMER
insert [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMER
select * from TBL_CUSTOMER

delete from [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMERS
insert [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMERS
select * from TBL_CUSTOMER

delete from [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMER_CONTACT
insert [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMER_CONTACT
select * from TBL_CUSTOMER_CONTACT

delete from [SERVER12].[SMECustomer360].dbo.TBL_RELATION
insert [SERVER12].[SMECustomer360].dbo.TBL_RELATION
select * from TBL_RELATION

delete from [SERVER12].[SMECustomer360].dbo.tbl_toi
insert [SERVER12].[SMECustomer360].dbo.tbl_toi
select * from tbl_toi
---------------table TBL_CUSTOMER_FEEDBACK
delete from [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMER_FEEDBACK
insert [SERVER12].[SMECustomer360].dbo.TBL_CUSTOMER_FEEDBACK
select * from TBL_CUSTOMER_FEEDBACK

delete from [SERVER12].[SMECustomer360].dbo.tbl_cust_feedback_raw
insert [SERVER12].[SMECustomer360].dbo.tbl_cust_feedback_raw
select * from tbl_cust_feedback_raw

---------------table product
delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_DEPOSIT
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_DEPOSIT
select * from TBL_CM_DEPOSIT

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_LOAN
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_LOAN
select * from TBL_CM_LOAN

delete from [SERVER12].[SMECustomer360].dbo.TBL_NEW_PR_LOAN
insert [SERVER12].[SMECustomer360].dbo.TBL_NEW_PR_LOAN
select * from TBL_NEW_PR_LOAN 

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_CARD
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_CARD
select * from TBL_CM_CARD

delete from [SERVER12].[SMECustomer360].dbo.[TBL_CM_CARD_NEW]
insert [SERVER12].[SMECustomer360].dbo.[TBL_CM_CARD_NEW]
select * from [TBL_CM_CARD_NEW]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_CARD_DAILY_RAW]
insert [SERVER12].[SMECustomer360].dbo.[TBL_CARD_DAILY_RAW]
select * from [TBL_CARD_DAILY_RAW]


delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_I2B
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_I2B
select * from TBL_CM_I2B

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_I2B_DETAIL
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_I2B_DETAIL
select * from TBL_CM_I2B_DETAIL

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_POS
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_POS
select * from TBL_CM_POS

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_TRADE
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_TRADE
select * from TBL_CM_TRADE

delete from [SERVER12].[SMECustomer360].dbo.TBL_TT_CHUOI
insert [SERVER12].[SMECustomer360].dbo.TBL_TT_CHUOI
select * from TBL_TT_CHUOI

---------------table TBL_HR_GROUP_COUNT
delete from [SERVER12].[SMECustomer360].dbo.TBL_HR_GROUP_COUNT
insert [SERVER12].[SMECustomer360].dbo.TBL_HR_GROUP_COUNT
select * from TBL_HR_GROUP_COUNT

---------------table sale performance

delete from [SERVER12].[SMECustomer360].dbo.TBL_SP_DEPOSIT_EOP
insert [SERVER12].[SMECustomer360].dbo.TBL_SP_DEPOSIT_EOP
select * from TBL_SP_DEPOSIT_EOP

delete from [SERVER12].[SMECustomer360].dbo.TBL_SP_LOAN_EOP
insert [SERVER12].[SMECustomer360].dbo.TBL_SP_LOAN_EOP
select * from TBL_SP_LOAN_EOP

delete from [SERVER12].[SMECustomer360].dbo.TBL_SP_TRADE_EOP
insert [SERVER12].[SMECustomer360].dbo.TBL_SP_TRADE_EOP
select * from TBL_SP_TRADE_EOP

delete from [SERVER12].[SMECustomer360].dbo.TBL_SP_CASH_MANAGEMENT_EOP
insert [SERVER12].[SMECustomer360].dbo.TBL_SP_CASH_MANAGEMENT_EOP
select * from TBL_SP_CASH_MANAGEMENT_EOP

---------------table hr
delete from [SERVER12].[SMECustomer360].dbo.TBL_HR
insert [SERVER12].[SMECustomer360].dbo.TBL_HR
select * from TBL_HR

delete from [SERVER12].[SMECustomer360].dbo.[TBL_DEPARTMENT_SME]
insert [SERVER12].[SMECustomer360].dbo.[TBL_DEPARTMENT_SME]
select * from [TBL_DEPARTMENT_SME]

delete from [SERVER12].[SMECustomer360].dbo.TBL_BRANCH
insert [SERVER12].[SMECustomer360].dbo.TBL_BRANCH
select * from TBL_BRANCH

------------table profitability

delete from [SERVER12].[SMECustomer360].dbo.TBL_PROFITABILITY
insert [SERVER12].[SMECustomer360].dbo.TBL_PROFITABILITY
select * from TBL_PROFITABILITY


---------------table cross selling
delete from [SERVER12].[SMECustomer360].dbo.TBL_X_SELLING_CUSTOMER
insert [SERVER12].[SMECustomer360].dbo.TBL_X_SELLING_CUSTOMER
select * from TBL_X_SELLING_CUSTOMER

delete from [SERVER12].[SMECustomer360].dbo.TBL_X_SELLING_PRODUCT
insert [SERVER12].[SMECustomer360].dbo.TBL_X_SELLING_PRODUCT
select * from TBL_X_SELLING_PRODUCT

--select * from [SERVER12].[SMECustomer360].dbo.TBL_X_SELLING_PRODUCT

delete from [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_PRE_APPROVED_CREDIT_CARD
insert [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_PRE_APPROVED_CREDIT_CARD
select * from TBL_XSELLING_PRE_APPROVED_CREDIT_CARD

delete from [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_PRE_BIL_NEW
insert [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_PRE_BIL_NEW
select * from TBL_XSELLING_PRE_BIL_NEW

delete from [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_PRE_WC
insert [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_PRE_WC
select * from TBL_XSELLING_PRE_WC

delete from [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_RATE_USING_LIMIT
insert [SERVER12].[SMECustomer360].dbo.TBL_XSELLING_RATE_USING_LIMIT
select * from TBL_XSELLING_RATE_USING_LIMIT

---------------table alert
delete from [SERVER12].[SMECustomer360].dbo.TBL_LIST_BAD_BANK
insert [SERVER12].[SMECustomer360].dbo.TBL_LIST_BAD_BANK
select * from TBL_LIST_BAD_BANK

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_OVERDUE
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_OVERDUE
select * from TBL_CM_ALERT_OVERDUE

delete from [SERVER12].[SMECustomer360].dbo.[TBL_ALERT_CARD_OVERDUE]
insert [SERVER12].[SMECustomer360].dbo.[TBL_ALERT_CARD_OVERDUE]
select * from [TBL_ALERT_CARD_OVERDUE]

delete from [SERVER12].[SMECustomer360].dbo.TBL_ALERT_BAD_BANK
insert [SERVER12].[SMECustomer360].dbo.TBL_ALERT_BAD_BANK
select * from TBL_ALERT_BAD_BANK

delete from [SERVER12].[SMECustomer360].dbo.tbl_alert_badbank_bottomup
insert [SERVER12].[SMECustomer360].dbo.tbl_alert_badbank_bottomup
select * from tbl_alert_badbank_bottomup

delete from [SERVER12].[SMECustomer360].dbo.TBL_ALERT_BAD_BANK_TOPDOWN
insert [SERVER12].[SMECustomer360].dbo.TBL_ALERT_BAD_BANK_TOPDOWN
select * from TBL_ALERT_BAD_BANK_TOPDOWN

delete from [SERVER12].[SMECustomer360].dbo.TBL_ALERT_BAD_BANK_WATCHLIST
insert [SERVER12].[SMECustomer360].dbo.TBL_ALERT_BAD_BANK_WATCHLIST
select * from TBL_ALERT_BAD_BANK_WATCHLIST

delete from [SERVER12].[SMECustomer360].dbo.TBL_ALERT_LOAN_MATDT
insert [SERVER12].[SMECustomer360].dbo.TBL_ALERT_LOAN_MATDT
select * from TBL_ALERT_LOAN_MATDT

delete from [SERVER12].[SMECustomer360].dbo.TBL_ALERT_DEPOSIT_MATDT
insert [SERVER12].[SMECustomer360].dbo.TBL_ALERT_DEPOSIT_MATDT
select * from TBL_ALERT_DEPOSIT_MATDT

delete from [SERVER12].[SMECustomer360].dbo.TBL_ALERT_CURRENT_ACCOUNT
insert [SERVER12].[SMECustomer360].dbo.TBL_ALERT_CURRENT_ACCOUNT
select * from TBL_ALERT_CURRENT_ACCOUNT

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_LC
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_LC
select * from TBL_CM_ALERT_LC

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_BL
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_BL
select * from TBL_CM_ALERT_BL

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_INACTIVE
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_INACTIVE
select * from TBL_CM_ALERT_INACTIVE

delete from [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_LIMIT
insert [SERVER12].[SMECustomer360].dbo.TBL_CM_ALERT_LIMIT
select * from TBL_CM_ALERT_LIMIT

delete from [SERVER12].[SMECustomer360].dbo.[TBL_CHECKLIST_DOC_HIDE_ANSWER]
insert [SERVER12].[SMECustomer360].dbo.[TBL_CHECKLIST_DOC_HIDE_ANSWER]
select * from [TBL_CHECKLIST_DOC_HIDE_ANSWER]

update DATE_EM_REPORT
set is_update = 'true'

select * from TBL_CM_LOAN

delete from [SERVER12].[SMECustomer360].dbo.[TBL_CUSTOMER_LOW_VALUE]
insert [SERVER12].[SMECustomer360].dbo.[TBL_CUSTOMER_LOW_VALUE]
select * from [TBL_CUSTOMER_LOW_VALUE]


--select * from TBL_PROFITABILITY
----------reduce rate fee


delete from [SERVER12].[SMECustomer360].dbo.TBL_REDUCE_LIMIT_INFO
insert [SERVER12].[SMECustomer360].dbo.TBL_REDUCE_LIMIT_INFO
select * from TBL_REDUCE_LIMIT_INFO

delete from [SERVER12].[SMECustomer360].dbo.TBL_REDUCE_FINANCE_INFO
insert [SERVER12].[SMECustomer360].dbo.TBL_REDUCE_FINANCE_INFO
select * from TBL_REDUCE_FINANCE_INFO

delete from [SERVER12].[SMECustomer360].dbo.[TBL_SALE_PERFORMANCE_KPI]
insert [SERVER12].[SMECustomer360].dbo.[TBL_SALE_PERFORMANCE_KPI]
select * from [TBL_SALE_PERFORMANCE_KPI]


delete from [SERVER12].[SMECustomer360].dbo.[TBL_ALERT_BAD_BANK_TOPDOWN]
insert [SERVER12].[SMECustomer360].dbo.[TBL_ALERT_BAD_BANK_TOPDOWN]
select * from [TBL_ALERT_BAD_BANK_TOPDOWN]





----------kpi



delete from [SERVER12].[SMECustomer360].dbo.[TBL_KPI_INFO]
insert [SERVER12].[SMECustomer360].dbo.[TBL_KPI_INFO]
select * from [TBL_KPI_INFO]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RANK_BRANCH]
insert [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RANK_BRANCH]
select * from [TBL_KPI_RANK_BRANCH]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_SALE_PERFORMANCE_KPI]
insert [SERVER12].[SMECustomer360].dbo.[TBL_SALE_PERFORMANCE_KPI]
select * from [TBL_SALE_PERFORMANCE_KPI]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RAW_CARD_DAILY]
insert [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RAW_CARD_DAILY]
select * from [TBL_KPI_RAW_CARD_DAILY]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RAW_DNBQ_DAILY]
insert [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RAW_DNBQ_DAILY]
select * from [TBL_KPI_RAW_DNBQ_DAILY]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RAW_KHHD_DAILY]
insert [SERVER12].[SMECustomer360].dbo.[TBL_KPI_RAW_KHHD_DAILY]
select * from [TBL_KPI_RAW_KHHD_DAILY]

delete from [SERVER12].[SMECustomer360].dbo.[tbl_KPI_msbo_raw]
insert [SERVER12].[SMECustomer360].dbo.[tbl_KPI_msbo_raw]
select * from [tbl_KPI_msbo_raw]


----------sale contest



delete from [SERVER12].[SMECustomer360].dbo.[TBL_SALE_CONTEST_PROGRAM]
insert [SERVER12].[SMECustomer360].dbo.[TBL_SALE_CONTEST_PROGRAM]
select * from [TBL_SALE_CONTEST_PROGRAM]

delete from [SERVER12].[SMECustomer360].dbo.TBL_SALE_CONTEST_PROGRAM_INFO
insert [SERVER12].[SMECustomer360].dbo.TBL_SALE_CONTEST_PROGRAM_INFO
select * from TBL_SALE_CONTEST_PROGRAM_INFO

delete from [SERVER12].[SMECustomer360].dbo.[TBL_SALE_CONTEST_BILAWARD_RANKING_DAILY]
insert [SERVER12].[SMECustomer360].dbo.[TBL_SALE_CONTEST_BILAWARD_RANKING_DAILY]
select * from [TBL_SALE_CONTEST_BILAWARD_RANKING_DAILY]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_SALE_CONTEST_BIL_AWARD_RAW]
insert [SERVER12].[SMECustomer360].dbo.[TBL_SALE_CONTEST_BIL_AWARD_RAW]
select * from [TBL_SALE_CONTEST_BIL_AWARD_RAW]


delete from [SERVER12].[SMECustomer360].dbo.TBL_PRODUCTHANDBOOK_CATEGORY
insert [SERVER12].[SMECustomer360].dbo.TBL_PRODUCTHANDBOOK_CATEGORY
select * from TBL_PRODUCTHANDBOOK_CATEGORY



 delete from  [SERVER12].[SMECustomer360].dbo.tbl_date_business
insert [SERVER12].[SMECustomer360].dbo.tbl_date_business
select * from tbl_date_business



delete from [SERVER12].[SMECustomer360].dbo.TBL_GENERAL_ALERT
insert [SERVER12].[SMECustomer360].dbo.TBL_GENERAL_ALERT
select * from TBL_GENERAL_ALERT

------customer need update info

delete from [SERVER12].[SMECustomer360].dbo.TBL_CHECK_CUSTOMER_INFO_UNPIVOT
insert [SERVER12].[SMECustomer360].dbo.TBL_CHECK_CUSTOMER_INFO_UNPIVOT
select * from TBL_CHECK_CUSTOMER_INFO_UNPIVOT


delete from [SERVER12].[SMECustomer360].dbo.[TBL_CUSTOMER_NEED_UPDATE_INFO]
insert [SERVER12].[SMECustomer360].dbo.[TBL_CUSTOMER_NEED_UPDATE_INFO]
select * from [TBL_CUSTOMER_NEED_UPDATE_INFO]

delete from [SERVER12].[SMECustomer360].dbo.[TBL_CUSTOMER_INFO_CODE]
insert [SERVER12].[SMECustomer360].dbo.[TBL_CUSTOMER_INFO_CODE]
select * from [TBL_CUSTOMER_INFO_CODE]
